package com.linkai.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.linkai.entity.Storage;

import java.math.BigDecimal;

/**
 * <p>
 * 库存 Mapper 接口
 * </p>
 *
 * @author yamon
 * @since 2021-02-27
 */
public interface StorageMapper extends BaseMapper<Storage> {
    /**
     * 更新商品，相加
     *
     * @param id
     * @param eachSum
     * @param bstoId
     * @param supId
     * @param inpordPrice
     * @return
     */
    int updateStorageByProId(Integer id, Integer productNum, BigDecimal eachSum, Integer bstoId, Integer supId, BigDecimal inpordPrice);

    /**
     * 更新商品数量，相减
     * @param id
     * @param num
     * @return
     */
    boolean updateProductNumByProId(Integer id, Integer num,BigDecimal eachSum,BigDecimal price,Integer stoId,Integer supId);
}
